<div id="sidebar">
    <div class="sidebar_panel">
        <div class="title">+ Companys</div>
        <div class="sidebar_content">
            {{foreach $Data["tourtype"] as $v}}
            <h2><a href="{{'tourandteam/company/'|cat:$v->_alias|base_url}}">+ {{$v->_name}}</a></h2>
            {{/foreach}}
            
        </div>
    </div>
    <div class="sidebar_panel">
                <div class="title">+ Book this tour</div>
            <form action="{{base_url("sys/excution/nothing")}}" 
                  name="frmbook"
                  target="integration_asynchronous"
                  onsubmit="book()"
                  method="post">
                <label>Full name</label><br />
                <input type="text" id="txtFullName" name="txtFullName" class="text" title=""/><br />
                <label>Age</label><br />
                <input type="text" id="txtAge" name="txtAge" class="text" title=""/><br />
                <label>Number of people</label><br />
                <input type="text" id="txtNum" name="txtNum" class="text" title=""/><br />
                <label>Date</label><br />
                <input type="text" id="txtDate" name="txtDate" class="text" title=""/><br />
                <label>Pick up location</label><br />
                <input type="text" id="txtLocation" name="txtLocation" class="text" title=""/><br />
                <label>Phone Number</label><br />
                <input type="text" id="txtPhone" name="txtPhone" class="text" title=""/><br />
                <label>Email</label><br />
                <input type="text" id="txtEmail" name="txtEmail" class="text" title=""/><br />
                <hr />
                <input type="image" name="imageField" 
                       id="imageField" class="button" 
                       onclick="document.frmbook.submit()"
                       src="{{base_url()}}PushClimb/images/booking_butt.gif" />
            </form>
        </div>
</div>
<script type="text/javascript">
    function book(){
        if(isrunning)return;
        var url,data;
        url="{{base_url()}}tourandteam/book";
        
        data={
            Tour          :   "{{$Data["tourindex"]->ID}}",
            FullName    :   $("#txtFullName").val(),
            Num         :   $("#txtNum").val(),
            Date        :   $("#txtDate").val(),
            Location    :   $("#txtLocation").val(),
            Email       :   $("#txtPhone").val(),
            Phone       :   $("#txtEmail").val(),
            Age         :   $("#txtAge").val()
        }
        isrunning=true;
        debugAjax(url,data,function(result){
            isrunning=false;
            if(result.code>=0){
                document.frmbook.reset();
                ShowNoticeDialogMessage(result.msg);
            }else{
                ShowNoticeDialogMessage(result.msg);
            }
        });
    }
</script>